<?php if(isset($this->head)) : ?>
<table cellspacing="0">
    <thead>
        <tr>
        <?php foreach($this->head['headers'] as $header) : ?>
            <?php $align='left' ?>
            <?php if(isset($header[3])&&($header[3] == 'Number')) : ?>
                        <?php $align='right' ?>
            <?php endif ?>
            <th align="<?php echo $align ?>"><?php echo $header[2] ?></th>
        <?php endforeach ?>
        </tr>
    </thead>
    <tbody>
        <?php foreach($this->body as $row) : ?>
        <tr>
            <?php foreach($this->head['headers'] as $header) : ?>
                <?php $align='left' ?>
                <?php if(isset($header[3])&&($header[3] == 'Number')) : ?>
                    <?php $align='right' ?>
                    <?php if(isset($header[4])&&($header[4] == 'Standard')) : ?>
                        <?php $row[$header[0]] = number_format($row[$header[0]],2,'.',','); ?>
                    <?php endif ?>
                <?php endif ?>
                <td align="<?php echo $align ?>">
                    <?php echo $row[$header[0]] ?>
                </td>  
            <?php endforeach ?>
        </tr>
        <?php endforeach ?>
    </tbody>
    <tfoot>
        <tr>
        <?php foreach($this->foot as $index => $footer) : ?>
            <?php $align='left' ?>
            <?php foreach($this->head['headers'] as $header) : ?>
                <?php if(($header[0]==$index)&&isset($header[3])&&($header[3] == 'Number')) : ?>
                    <?php $align='right' ?>
                <?php endif ?>
            <?php endforeach ?>
            <th align="<?php echo $align ?>"><?php echo $footer ?></th>
        <?php endforeach ?>
        </tr>
    </tfoot>
</table>
<?php endif ?>